當前位置: 首頁> 函數類別大全> timezone_open

timezone_open

DateTimeZone::__construct的別名- 創建新的DateTimeZone對象
名稱:timezone_open
分類:日期和時間
所屬語言:php
一句話介紹:創建新的DateTimeZone 對象。

定義和用法

timezone_open()創建新的DateTimeZone 對象。

實例

創建新的DateTimeZone 對象,然後返回時區的名稱:

 <?php
$tz = timezone_open ( "Asia/Shanghai" ) ;
echo timezone_name_get ( $tz ) ;
?>

親自試一試

文法

timezone_open ( timezone ) ;
參數 描述
timezone

必需。規定時區。

提示:查看PHP 中支持的所有時區列表。

同類函數
熱門文章